/**
 * 我的发布
 * @author Qasim <15750783791@163.com>
 * @version 2016/9/6
 */
var self = memberInfo = '';


document.addEventListener('plusready' , ready ,  false);

function ready(){
	
	self = plus.webview.currentWebview(); 
	
	memberInfo = plus.storage.getItem('memberInfo');
	memberInfo = $.parseJSON(memberInfo);
	
	$('.demand').text(self.content);
	$('.proposal').text(self.proposal ? self.proposal : '暂无建议');
	var id = self.aid;
	
	//修改需求
	$('.modify_demand').on('click' , function(){ 
		plus.nativeUI.showWaiting('跳转中...');
		var me_fb_xg = plus.webview.create('me-fb-xg.html', 'me_fb_xg', {}, {
			aid : id,
			top_page :self.page,
			page : self.id,
			uid : memberInfo.aid
		});
		me_fb_xg.addEventListener('loaded', function (){
			me_fb_xg.show('pop-in');
			plus.nativeUI.closeWaiting();
		})
	})
 	 
}



window.addEventListener('update_demand',function(event){
	$('.demand').text(event.detail.demand);
});



